<%@page import="com.view.PageDetailsView"%>
<%@page import="com.view.LeaveDetailView"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Leave Details</title>
<link rel="stylesheet" type="text/css" href="css/datePicker.css">

<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.datePicker.js"></script>
<script type="text/javascript" src="js/date.js"></script>
<script type="text/javascript" >
$(function()
	{
		$('.date-pick').datePicker({startDate:'01/01/2000'});
		if(document.getElementById('resulttabs') != null){
			var results=new ddtabcontent("resulttabs");
			results.setpersist(false);
			
			results.init();
		}
	});
</script>

<style>
	a.dp-choose-date {
		float: left;
		width: 16px;
		height: 16px;
		padding: 0;
		margin: 5px 3px 0;
		display: block;
		text-indent: -2000px;
		overflow: hidden;
		background: url(img/calendar.png) no-repeat;
	}

	a.dp-choose-date.dp-disabled {
		background-position: 0 -20px;
		cursor: default;
	}

	input.dp-applied {
		width: 140px;
		float: left;
	}

</style>
</head>
<body>
<%
	LeaveDetailView detailView = (LeaveDetailView)request.getAttribute("leaveDetailView");
	PageDetailsView pageView = (PageDetailsView)request.getAttribute("pageView");
%>

<div id="ApplyLeave">
<%
	if(request.getAttribute("error") !=null && !request.getAttribute("error").equals("") ){
%>
<br>
<table border="0" cellpadding="0" cellspacing="0" width="650" align="center">
	<tr bgcolor="#aaaaaa">
		<td align="center">

		<table cellspacing="1" cellpadding="4" border="0" width="650">
			<tr>
				<td bgcolor="#004080" align="center" colspan=""><font
					face="Arial" size="3" color="RED" style="font-size: 15px;">
				<b> ERROR : <%=request.getAttribute("error") %></b> </font></td>
			</tr>

			<tr>
				<td bgcolor="#ececec" align="center"><font face="Verdana"
					size="5" style="font-size: 20px; "> <marquee><font color="blue">There was a problem in last operation</font></marquee> </font></td>
			</tr>
		</table>
		</td>
	</tr>
</table>
<br>
<%} %>
<%
	if(request.getAttribute("Message") !=null && !request.getAttribute("Message").equals("") ){
%>
<br>
<table border="0" cellpadding="0" cellspacing="0" width="650" align="center">
	<tr bgcolor="#aaaaaa">
		<td align="center">

		<table cellspacing="1" cellpadding="4" border="0" width="650">
			<tr>
				<td bgcolor="Green" align="center" colspan=""><font
					face="Arial" size="3" color="White" style="font-size: 15px;">
				<b>  <%=request.getAttribute("Message") %></b> </font></td>
			</tr>
		</table>
		</td>
	</tr>
</table>
<br>
<%} %>
<form action="/LMS/LeaveApplyServlet?MODO=formSubmit" name="ApplyLeaveForm" method="post">
<input type="hidden" value="<%=detailView.getUserId()%>" name="userId">
<table border="0" cellpadding="0" cellspacing="0" width="650" align="center">
	<tr>
		<td bgcolor="#004080" align="center" colspan="3"><font
			face="Arial" size="3" color="white" style="font-size: 15px;">
		<b>Available leave details</b> </font></td>
	</tr>
	<tr>
		<td colspan="3">
			<table border="2" cellpadding="0" cellspacing="0" width="650">
				<tr>
					<th>Casual Leave</th>
					<th>Earned Leave</th>
					<th>Sick Leave</th>
				</tr>
				<tr>
					<td align="center"> <%=detailView.getCasualLeaveCount() %></td>
					<td align="center"> <%=detailView.getEarnedLeaveCount() %></td>
					<td align="center"> <%=detailView.getSickLeaveCount() %></td>
				</tr>
			</table>
		</td>
	</tr>
</table>
<br>
	<table border="0" cellpadding="0" cellspacing="0" width="600"
		align="left">
		<tr bgcolor="#cccccc">
			<td align="left" width="200"><font
				face="Arial" size="3"  style="font-size: 15px;font-weight: bolder;">
				Start Date :-
			</font>
			</td>
			<td align="left" width="400">
				<input type="text" name="fromdate" size="14" maxlength="10"
					title="DD/MM/YYYY" value="<%=pageView.getFromDate()%>" class="date-pick" readonly="readonly"></td>
		</tr>
		<tr bgcolor="#ececec">
			<td align="left" width="200"><font
				face="Arial" size="3"  style="font-size: 15px;font-weight: bolder;">
				End Date :-
			</font>
			</td>
			<td align="left" width="400">
				<input type="text" name="todate" size="14" maxlength="10"
					title="DD/MM/YYYY" value="<%=pageView.getToDate()%>" class="date-pick" readonly="readonly"></td>
		</tr>
		<tr bgcolor="#cccccc">
			<td align="left" width="200"><font
				face="Arial" size="3"  style="font-size: 15px;font-weight: bolder;">
				Leave Type :-
			</font>
			</td>
			<td align="left" width="400">
				<select name="leaveType">
					<option value="CL"> Causal Leave</option>
					<option value="EL"> Earned Leave</option>
					<option value="SL">Sick Leave</option>
				</select>
			</td>
		</tr>
		<tr bgcolor="#ececec">
			<td align="left" width="200"><font
				face="Arial" size="3"  style="font-size: 15px;font-weight: bolder;">
				Reason :-
			</font>
			</td>
			<td align="left" width="400">
				<input type="text" name="leaveReason" size="30" maxlength="20"
					title="Reason" value="<%=pageView.getLeaveReason()%>"></td>
		</tr>
		<tr bgcolor="#ececec">
			<tr bgcolor="#ececec">
				<td colspan="2" align="center"><input type="Submit"
					value="Apply Leave" style="font-size: 15px; font-family: Verdana">
				</td>
			</tr>
	</table>
</form>
</div>

</body>
</html>